home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 26 / Cream of the Crop 26.iso / os2 / octa209s.zip / octave-2.09 / src / oct-fstrm.h < prev    next >
C/C++ Source or Header  |  1997-01-29  |  2KB  |  82 lines

  1. /*
  2.  
  3. Copyright (C) 1996 John W. Eaton
  4.  
  5. This file is part of Octave.
  6.  
  7. Octave is free software; you can redistribute it and/or modify it
  8. under the terms of the GNU General Public License as published by the
  9. Free Software Foundation; either version 2, or (at your option) any
  10. later version.
  11.  
  12. Octave is distributed in the hope that it will be useful, but WITHOUT
  13. ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  14. FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  15. for more details.
  16.  
  17. You should have received a copy of the GNU General Public License
  18. along with Octave; see the file COPYING.  If not, write to the Free
  19. Software Foundation, 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
  20.  
  21. */
  22.  
  23. #if !defined (octave_octave_fstream_h)
  24. #define octave_octave_fstream_h 1
  25.  
  26. #include <fstream.h>
  27.  
  28. #include "oct-stream.h"
  29.  
  30. class
  31. octave_fstream : public octave_base_stream
  32. {
  33. public:
  34.  
  35.   octave_fstream (const string& nm_arg,
  36.           ios::openmode md = ios::in|ios::out,
  37.           oct_mach_info::float_format flt_fmt =
  38.           oct_mach_info::native);
  39.  
  40.   ~octave_fstream (void) { }
  41.  
  42.   // Position a stream at OFFSET relative to ORIGIN.
  43.  
  44.   int seek (streamoff offset, ios::seek_dir origin);
  45.  
  46.   // Return current stream position.
  47.  
  48.   long tell (void) const;
  49.  
  50.   // Return non-zero if EOF has been reached on this stream.
  51.  
  52.   bool eof (void) const;
  53.  
  54.   // The name of the file.
  55.  
  56.   string name (void);
  57.  
  58.   istream *input_stream (void);
  59.  
  60.   ostream *output_stream (void);
  61.  
  62. private:
  63.  
  64.   string nm;
  65.  
  66.   fstream fs;
  67.  
  68.   // No copying!
  69.  
  70.   octave_fstream (const octave_fstream&);
  71.  
  72.   octave_fstream& operator = (const octave_fstream&);
  73. };
  74.  
  75. #endif
  76.  
  77. /*
  78. ;;; Local Variables: ***
  79. ;;; mode: C++ ***
  80. ;;; End: ***
  81. */
  82.